package com.sunshine.hooktest;

import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.sunshine.R;

import java.util.List;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Uri uri = getIntent().getData();
        if (null != uri) {
            String host = uri.getHost();
            String path = uri.getPath();
            System.out.println("host = " + host);
            System.out.println("path = " + path);
            List<String> pathList = uri.getPathSegments();
            for (String temp : pathList) {
                System.out.println("temp = " + temp);
            }
        }
    }
}
